home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
cafead1a
/
frmini.frm
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1999-10-06
|
6KB
|
194 lines
VERSION 4.00
Begin VB.Form frmIni
Caption = "Administrator Settings"
ClientHeight = 3060
ClientLeft = 1890
ClientTop = 3435
ClientWidth = 5535
Height = 3495
Left = 1830
LinkTopic = "Form1"
ScaleHeight = 3060
ScaleWidth = 5535
Top = 3060
Width = 5655
Begin VB.CommandButton cmdGetTime
Caption = "View Remaining Time"
Height = 375
Left = 3195
TabIndex = 12
Top = 285
Width = 2190
End
Begin VB.TextBox txtTime
Height = 330
Left = 1935
TabIndex = 10
Top = 750
Width = 1035
End
Begin VB.CommandButton Command1
Caption = "View Password List "
Height = 360
Left = 1215
TabIndex = 9
Top = 1665
Width = 3195
End
Begin VB.CommandButton Command4
Caption = "End Internet Cafe Program"
Height = 360
Left = 1215
TabIndex = 8
Top = 2625
Width = 3195
End
Begin VB.CommandButton Command3
Caption = "Close Administrator Window"
Height = 360
Left = 1215
TabIndex = 6
Top = 2130
Width = 3210
End
Begin VB.CommandButton cmdSave2
Caption = "Save New Password"
Height = 360
Left = 3210
TabIndex = 5
Top = 1155
Width = 2220
End
Begin VB.CommandButton cmdClear
Caption = "Reset Time and Password"
Height = 375
Left = 3195
TabIndex = 4
Top = 720
Width = 2220
End
Begin VB.TextBox txtValue2
Height = 330
Left = 1950
TabIndex = 3
Top = 1185
Width = 1035
End
Begin VB.TextBox txtUser
Height = 330
Left = 1920
TabIndex = 2
Top = 300
Width = 1035
End
Begin VB.Label Label4
Alignment = 2 'Center
Caption = "Remaining Time"
Height = 285
Left = 45
TabIndex = 11
Top = 735
Width = 1350
End
Begin VB.Label Label3
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "View and Edit Passwords"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 840
TabIndex = 7
Top = 0
Width = 3180
End
Begin VB.Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Administrator Password"
Height = 270
Left = -60
TabIndex = 1
Top = 1170
Width = 1995
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "User Password"
Height = 345
Left = 0
TabIndex = 0
Top = 345
Width = 1395
End
Attribute VB_Name = "frmIni"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdClear_Click() 'will create new password and set time for it
Dim lngResult As Long
Dim strFileName
On Error GoTo Err
strFileName = App.Path & "\Passwords.ini"
If txtUser.Text = "" Or txtTime.Text = "" Then Exit Sub
lngResult = WritePrivateProfileString("Passwords", _
txtUser.Text, txtTime.Text, strFileName)
Exit Sub
End Sub
Private Sub cmdGetTime_Click()
Dim strResult As String * 60 'no variable length strings allowed
Dim lngResult As Long
Dim strFileName As String
strFileName = App.Path & "\Passwords.ini"
On Error GoTo Err
If txtUser.Text = "" Then Exit Sub 'must enter password
lngResult = GetPrivateProfileString("Passwords", _
txtUser.Text, strFileName, strResult, Len(strResult), _
strFileName)
txtTime.Text = Trim(strResult)
If Len(txtTime.Text) > 3 Then 'means there was no entry
txtTime.Text = "" 'and a path was returned-default
End If
Exit Sub
Err: txtTime.Text = "" 'clear time field
End Sub
Private Sub cmdSave2_Click() 'save new admin password
Dim lngResult2 As Long
Dim strFileName
strFileName = App.Path & "\Passwords.ini"
lngResult2 = WritePrivateProfileString("Passwords", _
"Administrator", txtValue2.Text, strFileName)
End Sub
Private Sub Command1_Click() 'show password list
Run Me, App.Path & "\Passwords.ini"
End Sub
Private Sub Command3_Click() 'close admin window
frmIni.Hide
Cafe.Label4.Visible = False
Cafe.Label5.Visible = False
Cafe.cmdLogOn.Visible = False
Cafe.txtPass.Text = ""
End Sub
Private Sub Command4_Click() 'end program
TaskBar True 'show taskbar
DisableKeys False 'make keys work again
End Sub
Private Sub Form_Load() 'show admin password
Dim strFileName As String
Dim lngResult2 As Long
Dim strResult2 As String * 60
strFileName = App.Path & "\Passwords.ini"
lngResult2 = GetPrivateProfileString("Passwords", _
"Administrator", strFileName, strResult2, Len(strResult2), _
strFileName)
txtValue2.Text = Trim(strResult2)
End Sub